Skip to content

Conversation

StefH
Copy link
Collaborator

@StefH StefH commented Oct 13, 2025

No description provided.

@StefH StefH requested a review from Copilot October 13, 2025 08:22
@StefH StefH self-assigned this Oct 13, 2025
@StefH StefH added the bug label Oct 13, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the probability logic in WireMock.Net's mapping matcher and adds probability testing functionality. The key issue was that the probability comparison was inverted, causing mappings with higher probability values to be selected less frequently than intended.

  • Corrected the probability comparison logic from <= to > to properly filter mappings based on their probability
  • Enhanced the mapping selection ordering to consider probability values in tie-breaking scenarios
  • Added comprehensive probability testing in the example application to validate the fix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/WireMock.Net.Minimal/Owin/MappingMatcher.cs Fixed probability filtering logic and improved mapping selection ordering
examples/WireMock.Net.Console.NET8/Program.cs Updated main method to support async operations for probability testing
examples/WireMock.Net.Console.NET8/MainApp.cs Added probability testing code to validate the fix with statistical verification

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@StefH StefH requested a review from Copilot October 13, 2025 09:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.44%. Comparing base (f6c5225) to head (cbf1e39).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1367      +/-   ##
==========================================
- Coverage   35.71%   34.44%   -1.28%     
==========================================
  Files         152      164      +12     
  Lines       34539    41307    +6768     
==========================================
+ Hits        12337    14227    +1890     
- Misses      21777    26641    +4864     
- Partials      425      439      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@StefH StefH merged commit 5885324 into master Oct 22, 2025
10 of 11 checks passed
@StefH StefH deleted the stef-1126-Prob branch October 22, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant